<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>安装通集采供应商库_优质供应商品牌_安装通</title>
    <meta name="description" content="安装通优质集采供应商库，是由多家优质的供应商组成，为采购商提供优质的产品资源，让采购商不再为找产品而烦恼。">
    <meta name="keywords" content="集采供应商,优质供应商">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="/res/css/respective/xiangMuHui/xiangMuHui.css" rel="stylesheet">
    <link href="/res/css/mall/mallIndex.css" rel="stylesheet">
    <link href="/res/third/city-picker/css/city-picker.css" rel="stylesheet">
    <style type="text/css">
        .sxx b[data-name] {
            max-width: 50px;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
        }
        .city-picker-span{
            display: inline-block;
            border: none;
        }
        .city-picker-span > .arrow{
            top: 0px;
            right: 0px;
        }
        .city-picker-span.focus, .city-picker-span.open{
            border:none;
        }
        .city-picker-dropdown{
            text-align: left;
        }
        #products td{
        width: 300px;}
    </style>
</head>
[#assign link="center" /]
<body style="background-color: #f5f5f5;">
[#include "/front/common/front_headMal.html"]
<div class="w1200">
    <h6 class="bread" style="display: inline-block;margin-right: 15px;">当前位置：首页 &gt; 集采供应商</h6>
</div>
<div class="xiangMuHuiOuter suply">
    <div style="background: #f5f5f5;">
        <div class="spCent itermOne" style="background-color: white;">
            <div class="addIterm" id="searchItem">
                <strong>集采供应商</strong>
                <label style="margin-right: 30px;width: auto;" id="total">（0）</label>
                <div class="sxx">

                </div>
            </div>
            <hr>
            <div class="duoOuter danXuan" style="position: relative;padding-bottom: 30px;">
                <label style="width: 90px;">产品分类：</label>
                <div class="keXuan" id="categorySContainer" data-name="categorySId" style="height: auto;" >

                </div>
                [#--<div class="itermChose">
                    <a class="zhanKaiLink" onclick="more(this)">更多<i class="zhanKai"></i></a>
                </div>--]
            </div>
        </div>
    </div>
    <div style="background-color: #f5f5f5;padding-top: 15px;">
        <div class="spCent itermTwo">
            <table style="width: 1200px;">
                <caption style="border-bottom: 1px solid #dedede;background-color: white;">
                    <div style="display: inline-block;float: left;position: relative;">
                        <b class="acTab" onclick="switchTab(this)">综合排序</b>
                        <input id="areaProvince" value="" placeholder="全部地区" style="font-size: medium;">
                    </div>
                    <div class="fanYe">
                        <em style="color: #fca711;" id="pageNo">0</em>
                        <em style="margin-left: 0px;" id="pages" >/0</em>
                        <a id="prevPage" href="javascript:void(0);" >&lt;</a>
                        <a id="nextPage" style="margin-left: -4px;" href="javascript:void(0);">&gt;</a>
                    </div>
                </caption> 
            </table>
            <table>
            	 <tbody id="products" > 
                </tbody>
            </table>
        </div>
    </div>
</div>
<div id="laypage" style="text-align: center;margin: 40px auto;"></div>
[#include "/front/common/front_foot.html"]
</body>
<script type="text/html" id="categorysTemplate" >
    {{each list }}
    <dfn  class="categorys" {{if currentcat==$value.id }} style="color: red;"{{/if}} onclick="searchByCategory('{{$value.id}}')"  >{{$value.name}}</dfn>
    {{/each}}
</script>

<script type="text/html" id="template" >
    {{if total==0 }}
    <tr>
        <td colspan="4">
            <h3 class="sory" style="margin-top: 20px;text-align:center;">
                <img style="vertical-align: middle;margin-right: 5px;"  src="/res/images/oparaStatus/none_03.png"/>抱歉，没有找到相关集采供应商！
            </h3>
        </td>
    </tr>
    {{else}}
        {{each list as c i}}
        {{if i%4==0 }}
            <tr>
        {{/if}}
            <td>
                <div>
                    <p class="comBack" style="cursor: pointer;text-align:center;display:table-cell;vertical-align:middle;width:280px;" onclick="window.open('/shop/{{c.shop.id}}')">
						<img src="{{if c.logo}}{{c.logo}}{{else}}/res/images/defaltPic/suply.jpg{{/if}}" style="max-width:260px;max-height:70px;width: auto;"/>
                    </p>
					<div style="height:167px;">
                    <div class="comIntro">
                        <div>
                            <em>{{c.companyName}}</em>
                           [#-- <img src="/res/images/respective/mall/comType_03.jpg" alt="" width="22px" height="25px">--]
                        </div>
                        <div>
                            <h4>
                                <dfn>联系人：</dfn>
                                {{c.shop.cantactName}}
                            </h4>
                            {{if c.shop.display ==1 }}
                            <h4>
                                <dfn>手机号：</dfn>
                                {{c.shop.telSecret}}
                            </h4>
                            {{/if}}
                            {{if c.shop.phone && c.shop.phone!="" }}
                            <h4>
                                <dfn>固定电话：</dfn>
								{{ c.shop.phone.substring(0,3) }}****
                            </h4>
                            {{/if}}
                            <h4>
                                <dfn>地址：</dfn>
                                {{c.shop.provinceName}} {{c.shop.cityName}}
                            </h4>
                        </div>
                    </div>
</div>

                  [#--
                    <div class="sulyType">
                        {{each c.categories  }}
                            {{if $index != 0 }}
                                |
                            {{/if}}
                            <a href="/shop/{{c.shop.id}}/{{$value.id}}" target="_blank" >{{$value.categoryName}}</a>

                        {{/each}}
                    </div>
                   --]
                    <button onclick="location.href='/shop/{{c.shop.id}}';"   class="detail" type="button">查看详情</button>
                </div>
            </td>
            {{if  i!=0 &&  (i+1)%4==0   }}
               </tr>
            {{else if i==list.length-1 }}
                <%for(i = 0; i < (4-list.length%4); i ++) {%>
                    <td></td>
                <%}%>
                </tr>
            {{/if}}
        {{/each}}
    {{/if}}
</script>

<script src="/res/js/common/jquery.1.9.1.min.js"></script>
<script src="/res/js/common/jquery.ellipsis.js"></script>
<script src="/res/third/layer/layer.js"></script>
<script type="text/javascript" src="/res/third/laypage/laypage.js"></script>
<script src="/res/third/laytpl/laytpl.js"></script>
<script src="/res/third/laytpl/template.js"></script>
<script src="/res/third/layer/layer.extends.js"></script>
<script src="/res/third/city-picker/js/city-picker.data.js"></script>
<script src="/res/third/city-picker/js/city-picker.js"></script>
<script src="/res/js/common/common.js"></script>
<script type="text/javascript">

    var searchParam={categoryIds:"${(param.categoryIds)!}",pageNo:${param.pageNo!1},provinceCode:"${(param.provinceCode)!''}",cityCode:"${(param.cityCode)!''}" };
    [#--orderType 0默认,创建时间desc,1价格asc,2价格desc,3销量asc,4销量desc,5浏览量asc,6浏览量desc--]
    var selloffer = {
        _tempId:"template",
        _containerId:"products",
        _totalPage:0,
        offerSearch:function (rebuidpage,storestat) {//检索
            var _this =this;
            var data = searchParam;
            layer.post({
                url:"/center/center_search",
                data:JSON.stringify(data),
                contentType:"application/json",
                success:function (result) {
                    //类别
                    var categoryList = result.params.categoryList;
                    var currentcat = result.params.current;//用以三级选中的情况

                    var categoryhtml = template("categorysTemplate",{list:categoryList,currentcat:currentcat});
                    $('#categorySContainer').html(categoryhtml);

                    //头部分页
                    $("#total").text("("+result.totalCount+")");
                    $("#pageNo").text(result.totalCount==0?1:result.pageNo);
                    $("#pages").text("/ "+result.totalPage);
                    _this._totalPage=result.totalPage;

                    //产品
                    var html = template("template",{list:result.list,total:result.totalCount});
                    $('#products').html(html);


                    if(rebuidpage){
                        //底部分页
                        _this.layerPage(result.totalPage,_this);
                    }

                    if(!storestat){
                        //地区选择
                        _this.initCityPicker();
                    }


                    //保存状态
                    _this.pushUrl(storestat);
                }
            });
        },
        pushUrl:function(storestat,path){//path:url参数 ,storestat ,是否保存状态
            var href = path || location.href.split("?")[0];
            var params=[];
            if(searchParam.categoryIds!=""){
                params.push("categoryIds="+searchParam.categoryIds);
            }
            if(searchParam.provinceCode!=""){
                params.push("provinceCode="+searchParam.provinceCode);
            }
            if(searchParam.cityCode!=""){
                params.push("cityCode="+searchParam.cityCode);
            }

            if(searchParam.pageNo!=1){
                params.push("pageNo="+searchParam.pageNo);
            }

            var paramStr="";
            if(params.length!=0){
                href=href+"?"+params.join("&");
            }
            if ('pushState' in history && storestat ) {
                history.pushState(searchParam,document.title,href);
            }
            return href;
        },
        layerPage:function (totalPage,_this){//分页
            laypage({
                cont: 'laypage',
                pages: totalPage,
                first:1,
                last: totalPage,
                curr:searchParam.pageNo,
                skin: 'molv',
                jump: function(obj, first) {
                    if(!first){ //点击跳页触发函数自身，并传递当前页：obj.curr
                        window.scrollTo(0,200);
                        searchParam.pageNo=obj.curr;
                        _this.offerSearch(false,true);
                    }
                }
            });
        },
        initCityPicker:function(){//选择地区
            var provinceCode = searchParam.provinceCode;
            var cityCode = searchParam.cityCode;
            var values=[];
            if(provinceCode!=""){
                values.push(ChineseDistricts["no"+provinceCode]);
            }
            if(cityCode!=""){
                values.push(ChineseDistricts[provinceCode][cityCode]);
            }

            $("#areaProvince").val(values.join("/"));

            var hasinit = $("#areaProvince").data("citypicker");
            if(hasinit){
                hasinit.refresh(true,true);
            }
            //地区
            $("#areaProvince").citypicker({canremove:true,level:"city",simple:true,feedValBack:function (v,byhand) {
                var data = $("#areaProvince").data("citypicker");

                if(data){
                    var getcode = data.getCode().trim();
                    if(getcode==""){
                        searchParam.provinceCode="";
                        searchParam.cityCode="";
                    }else{
                        if(getcode.indexOf("/")!=-1){
                            var codes = getcode.split("/");
                            searchParam.provinceCode=codes[0];
                            searchParam.cityCode=codes[1];
                        }else{
                            searchParam.provinceCode=getcode;
                        }
                    }
                    if(!byhand){//不是手动调的refresh,则要存stat
                        selloffer.offerSearch(true,true);
                    }
                }
            }});
        },
        init:function(fn){
            _this = this;
            if (typeof fn === "function"){
                fn();
            }


            if ('pushState' in history) {
                window.addEventListener("popstate", function (e) {
                    if(history.state){
                        searchParam = history.state;
                        selloffer.offerSearch(true,false);
                    }
                });
            }
            this.offerSearch(true,true);
            this.initCityPicker();
            return this;
        }
    }.init(function(){
        //上一页
        $("#prevPage").click(function(){
            searchParam.pageNo=searchParam.pageNo>1?searchParam.pageNo-1:1;
            selloffer.offerSearch(true,true);
        });
        //下一页
        $("#nextPage").click(function(){
            searchParam.pageNo=searchParam.pageNo < selloffer._totalPage?searchParam.pageNo+1:selloffer._totalPage;
            selloffer.offerSearch(true,true);
        })
    });

    //选择类别
    function searchByCategory(categoryid) {
        if(searchParam.categoryIds != categoryid){
            searchParam.categoryIds=categoryid;
            searchParam.pageNo=1;
            selloffer.offerSearch(true,true);
        }
    }




/*

    /!**
     * 更多
     * *!/
    function more(obj) {
        $(obj).parent().prev().height("auto");
        $(obj).replaceWith('<a class="shouQiLink" onclick="less(this)">收起<i class="zhanKai shouQi"></i></a>');
    }

    /!**
     * 收起
     * *!/
    function less(obj) {
        $(obj).parent().prev().height("20px");
        $(obj).replaceWith('<a class="zhanKaiLink" onclick="more(this)">更多<i class="zhanKai"></i></a>');
    }

*/


</script>
</html>